{% extends "base.html" %}
{% load cms_tags %}
{% load i18n %}

{% block base_content %}
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<!-- content -->
				<div class="row">
					<div class="col-md-7">
						<div class="page-header">
							<big>{% trans "Recent events" %}</big>
						</div>
						<!-- <div class="container"> -->
						{% for event in event_recent_list %}
							{% if event.date != None and todayDateTime <= event.date %}
							<div class="row">
								<div class="col-md-12">
									<h4 class="text-info">{{ event.name }}</h4>
								</div>
							</div>
							<div class="row">
								<div class="col-md-8">
									<p><i class="fa fa-calendar-o"></i><strong> {{ event.date|date:"Y-m-d H:i" }} </strong> <i class="fa fa-map-marker"></i> {{ event.fieldName }}, {% trans event.county %}, {% trans event.country %}</p>
									<p>
										{% if event.signupEndDateTime != None and todayDateTime > event.signupEndDateTime %}
											<i class="fa fa-warning text-danger"></i> <small class="text-muted">{% trans "expired" %}</small>
										{% else %}
											{% if event.signupStartDateTime != None and todayDateTime < event.signupStartDateTime %}
												<small class="text-muted">{% trans "Signup is comming soon" %} - </small>
												<small class="text-muted">{% trans "signup date" %} :</small>
												<i><small class="text-info"><strong>{{ event.signupStartDateTime|date:"Y-m-d, H:i" }}</strong></small></i>
											{% else %}
												<small class="text-muted">{% trans "signup end date" %} :</small>
												<i><small class="text-danger"><strong>{{ event.signupEndDateTime|date:"Y-m-d, H:i" }}</strong></small></i>
											{% endif %}
										{% endif %}
									</p>
								</div>
								<div class="col-md-4">
									{% if event.signupEndDateTime != None and todayDateTime > event.signupEndDateTime %}
									<a class="btn btn-primary pull-right" href="/events/{{event.id}}/">{% trans "more info" %}</a>
									{% elif event.signupStartDateTime != None and todayDateTime < event.signupStartDateTime %}
									<a class="btn btn-info pull-right" href="/events/{{event.id}}/">{% trans "more info" %}</a>
									{% else %}
									<a class="btn btn-success pull-right" href="/events/{{event.id}}/">{% trans "more info & sign-up" %} </a>
									{% endif %}
								</div>
							</div>
							<div class="page-header">
							</div>
							{% endif %}
						{% empty %}
						{% endfor %}
						<!-- </div> -->
					</div>
					<div class="col-md-1">
					</div>
					<div class="col-md-4">
						<div class="page-header">
							<big>{% trans "Events record" %}</big>
						</div>
						<ul>
						{% for event in event_record_list %}
							{% if event.date != None and todayDateTime > event.date %}
							<!-- <li><p><a href="/events/{{ event.id }}/result/">{{ event.name }}, {{ event.date|date:"Y-m-d" }} @ {{ event.fieldName }}, {% blocktrans with event.county as county %}{{county}}{% endblocktrans  %} {{ event.country }}</a></p></li> -->
							<li><p><a href="/events/{{ event.id }}/result/">{{ event.name }}, {{ event.date|date:"Y-m-d" }} @ {{ event.fieldName }}, {% trans event.county %}, {% trans event.country %}</a></p></li>
							{% endif %}
						{% empty %}	
						{% endfor %}
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
{% endblock %}